<?php
$loader->requireOnce('includes/RadQueue/RadQueueItemModel.class.php');
abstract class ARadQueue {
	const QUEUE_TYPE_WAITING       =   'waiting';
	const QUEUE_TYPE_INPROGRESS    =   'in_progress';

	abstract public function renderQueue($roomId, $enumPatientType);

    abstract public function addItem($radTicketId, $roomId);

    abstract public function checkQueueItemExist($radTicketId);

    protected function buildQueueModel($roomId, $enumPatientType, $enumTicketStaus) {
    	$modelList =   array();
        $queueItemList  =   ORDataObject::factory('RadQueue')->getQueueItems($roomId, $enumPatientType, $enumTicketStaus);
        foreach ($queueItemList as $item) {
            $queueItemModel =   new RadQueueItemModel($item['rad_ticket_id'], $item['patient_id'], $item['patient_code'],
                $item['patient_name'], $item['start_waiting'], $item['waiting_time'], $item['treatment_department_id'], $item['treatment_department_name']);
            $modelList[]    =   $queueItemModel;
        }
        return $modelList;
    }

    public static function removeQueueItem($radTicketId) {
        ORDataObject::factory('RadQueue')->deleteAssignmentTicket($radTicketId);
    }
}
?>